﻿@{
    Bundle("jquery_rateit");
}

<ul class="unit-list sales-item">
@if((Model.Items as IEnumerable<dynamic>).Any())
{
    foreach(var i in Model.Items)
    {
        <li class="unit sales-item @(JDM.HasFlags(i.CatalogItem.Flags, "Promoted") ? "promoted" : String.Empty)">
            <header>
                <a href="@Url.Action(Loc.Act("Show").Set(new
                {
                    id = JDM.Int32(i.EntityID)
                }).Localized())">@JDM.String(i.SKU)</a>
                <nav>
                    @{
                        Html.RenderPartial("_PriceTag", (object)i);
                    }
                    <ul class="inlinebar">
                        <li>
                        @{
                            Html.RenderPartial("_BuyLink", (object)i);
                        }
                        </li>
                    </ul>
                </nav>
            </header>
            <section>
                <a href="@Url.Action(Loc.Act("Show").Set(new
                {
                    id = JDM.Int32(i.EntityID)
                }).Localized())">@{ Html.RenderPartial("_Image", (object)i.CatalogItem); }</a>
                @{
                    Html.RenderPartial("_ShortDescription", (object)i.CatalogItem);
                }
            </section>
            <footer>
                <div class="rating">
                    <div class="rateit" data-rateit-readonly="true" data-rateit-ispreset="false" data-rateit-value="@JDM.Byte(i.CatalogItem.RatingAverage)"></div>
                </div>
            </footer>
        </li>
    }
}
else
{
    <li class="empty"><span>@T(Res.In("Common").Of("Expr").Name("NoData"))</span></li>
}
</ul>

